# setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import os

extensions = [
    Extension("mymodule", ["mymodule.py"]),
]

# Build and clean steps
build_args = ["build_ext", "-b", ".mybuild"]
clean_args = ["clean", "--all"]

# Additional cleaning step to remove .c files
def clean_extra_files():
    for root, dirs, files in os.walk("."):
        for file in files:
            if file.endswith(".c"):
                os.remove(os.path.join(root, file))

setup(
    ext_modules = cythonize(extensions),
    script_args=build_args,
)

# Perform additional cleaning after build
clean_extra_files()
setup(script_args=clean_args)
